package com.hjq.demo.other.interfaces

import android.content.Context
import android.widget.ImageView

/**
 *    author : Yang
 *    time   : 2024/05/24
 *    desc   : 图像引擎
 */
interface ImageEngine {
    /**
     * load image
     *
     * @param context
     * @param url
     * @param imageView
     */
    fun loadImage(context: Context?, url: String?, imageView: ImageView?)

    /**
     * load image
     *
     * @param context
     * @param imageView
     * @param url
     * @param maxWidth
     * @param maxHeight
     */
    fun loadImage(
        context: Context?,
        imageView: ImageView?,
        url: String?,
        maxWidth: Int,
        maxHeight: Int
    )

    /**
     * load album cover
     *
     * @param context
     * @param url
     * @param imageView
     */
    fun loadAlbumCover(context: Context?, url: String?, imageView: ImageView?)

    /**
     * load picture list picture
     *
     * @param context
     * @param url
     * @param imageView
     */
    fun loadGridImage(context: Context?, url: String?, imageView: ImageView?)

    /**
     * When the recyclerview slides quickly, the callback can be used to pause the loading of resources
     *
     * @param context
     */
    fun pauseRequests(context: Context?)

    /**
     * When the recyclerview is slow or stops sliding, the callback can do some operations to restore resource loading
     *
     * @param context
     */
    fun resumeRequests(context: Context?)
}
